<?php
/* @var $this TugasAkhirController */
/* @var $model TugasAkhir */

$this->breadcrumbs=array(
	'Tugas Akhirs'=>array('index'),
	$model->Title=>array('view','id'=>$model->ID_TA),
	'Update',
);

$this->menu=array(
	array('label'=>'List TugasAkhir', 'url'=>array('index')),
	array('label'=>'Create TugasAkhir', 'url'=>array('create')),
	array('label'=>'View TugasAkhir', 'url'=>array('view', 'id'=>$model->ID_TA)),
	array('label'=>'Manage TugasAkhir', 'url'=>array('admin')),
);
?>

<h1>Update TugasAkhir <?php echo $model->ID_TA; ?></h1>

<?php 
$record = Yii::app()->db->createCommand()
                                ->select('ID_TAG')
                                ->from('ta_tag')
                                ->where("ID_TA=$model->ID_TA")
                                ->queryAll();

if (isset($record[0]['ID_TAG'])){ 
    $id_tag = $record[0]['ID_TAG']; 
    $tag1 = Yii::app()->db->createCommand()
                                ->select('tag')
                                ->from('tag')
                                ->where("ID_TAG=$id_tag")
                                ->queryAll();
    $tag_1 = $tag1[0]['tag'];
}
if (isset($record[1]['ID_TAG'])){ 
    $id_tag = $record[1]['ID_TAG']; 
    $tag2 = Yii::app()->db->createCommand()
                                ->select('tag')
                                ->from('tag')
                                ->where("ID_TAG=$id_tag")
                                ->queryAll();
    $tag_2 = $tag2[0]['tag'];
}
if (isset($record[2]['ID_TAG'])){ 
    $id_tag = $record[2]['ID_TAG']; 
    $tag3 = Yii::app()->db->createCommand()
                                ->select('tag')
                                ->from('tag')
                                ->where("ID_TAG=$id_tag")
                                ->queryAll();
    $tag_3 = $tag3[0]['tag'];
}
if (isset($record[3]['ID_TAG'])){ 
    $id_tag = $record[3]['ID_TAG']; 
    $tag4 = Yii::app()->db->createCommand()
                                ->select('tag')
                                ->from('tag')
                                ->where("ID_TAG=$id_tag")
                                ->queryAll();
    $tag_4 = $tag4[0]['tag'];
}
if (isset($record[4]['ID_TAG'])){ 
    $id_tag = $record[4]['ID_TAG']; 
    $tag5 = Yii::app()->db->createCommand()
                                ->select('tag')
                                ->from('tag')
                                ->where("ID_TAG=$id_tag")
                                ->queryAll();
    $tag_5 = $tag5[0]['tag'];
}

$pembimbing = Yii::app()->db->createCommand()
                                ->select('NIP')
                                ->from('membimbing')
                                ->where("ID_TA=$model->ID_TA")
                                ->queryAll();
$dos_bing = $pembimbing[0]['NIP'];

echo $this->renderPartial('_form', array('model'=>$model, 
                            'tag_1' => $tag_1,
                            'tag_2' => $tag_2,
                            'tag_3' => $tag_3,
                            'tag_4' => $tag_4,
                            'tag_5' => $tag_5,
                            'dos_bing' => $dos_bing,)); 
?>